/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufjf.pos.model.dao;

import br.ufjf.pos.model.Nivel;
import br.ufjf.pos.util.GenericDao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

/**
 *
 * @author rogerio
 */
public class NivelDAO extends GenericDao<Nivel, Integer>{

    @Override
    public void inserir(Nivel obj) throws SQLException, ClassNotFoundException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void alterar(Nivel obj) throws SQLException, ClassNotFoundException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void apagar(Nivel obj) throws SQLException, ClassNotFoundException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Nivel pesquisaChave(Integer obj) throws SQLException, ClassNotFoundException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public ArrayList<Nivel> buscarTodos() throws SQLException, ClassNotFoundException {
        String sql = "SELECT DFid_nivel_acesso, DFdescricao FROM TBnivel_acesso ";
        ArrayList<String> lista = new ArrayList<String>();        
        
        ArrayList<Nivel> listaPaciente = new ArrayList<Nivel>();
        
        ResultSet rs = executasql(sql, lista);
        while(rs.next()){               
            Nivel p = new Nivel(rs.getInt("DFid_nivel_acesso"),rs.getString("DFdescricao"));
            listaPaciente.add(p);
        } 
     
        return listaPaciente;
    }
    
    public String testeDImpressao(){
        return "narf";
    }
    
}
